.class final Lcom/brixd/niceapp/service/LoginService$2;
.super Ljava/lang/Object;
.source "LoginService.java"

# interfaces
.implements Lretrofit/Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/brixd/niceapp/service/LoginService;->signupUser(Landroid/content/Context;Lcom/brixd/niceapp/service/LoginService$SNSPlatform;Ljava/lang/String;Ljava/lang/String;J)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lretrofit/Callback",
        "<",
        "Lorg/json/JSONObject;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic val$context:Landroid/content/Context;

.field final synthetic val$snsType:Lcom/brixd/niceapp/service/LoginService$SNSPlatform;


# direct methods
.method constructor <init>(Lcom/brixd/niceapp/service/LoginService$SNSPlatform;Landroid/content/Context;)V
    .registers 3

    .prologue
    .line 116
    iput-object p1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$snsType:Lcom/brixd/niceapp/service/LoginService$SNSPlatform;

    iput-object p2, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$context:Landroid/content/Context;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public failure(Lretrofit/RetrofitError;)V
    .registers 4
    .param p1, "error"    # Lretrofit/RetrofitError;

    .prologue
    .line 148
    iget-object v0, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$context:Landroid/content/Context;

    # invokes: Lcom/brixd/niceapp/service/LoginService;->hideLoadingDialog(Landroid/content/Context;)V
    invoke-static {v0}, Lcom/brixd/niceapp/service/LoginService;->access$000(Landroid/content/Context;)V

    .line 149
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "/"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {p1}, Lretrofit/RetrofitError;->getMessage()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/zuiapps/suite/utils/log/LogUtil;->e(Ljava/lang/String;)V

    .line 150
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "fail at url "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {p1}, Lretrofit/RetrofitError;->getUrl()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0, p1}, Lcom/zuiapps/suite/utils/log/LogUtil;->e(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 151
    return-void
.end method

.method public bridge synthetic success(Ljava/lang/Object;Lretrofit/client/Response;)V
    .registers 3

    .prologue
    .line 116
    check-cast p1, Lorg/json/JSONObject;

    invoke-virtual {p0, p1, p2}, Lcom/brixd/niceapp/service/LoginService$2;->success(Lorg/json/JSONObject;Lretrofit/client/Response;)V

    return-void
.end method

.method public success(Lorg/json/JSONObject;Lretrofit/client/Response;)V
    .registers 6
    .param p1, "jsonObject"    # Lorg/json/JSONObject;
    .param p2, "response"    # Lretrofit/client/Response;

    .prologue
    .line 121
    iget-object v1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$snsType:Lcom/brixd/niceapp/service/LoginService$SNSPlatform;

    sget-object v2, Lcom/brixd/niceapp/service/LoginService$SNSPlatform;->QQ:Lcom/brixd/niceapp/service/LoginService$SNSPlatform;

    if-ne v1, v2, :cond_46

    .line 122
    iget-object v1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$context:Landroid/content/Context;

    const-string v2, "QQUserLogon"

    invoke-static {v1, v2}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;)V

    .line 127
    :cond_d
    :goto_d
    invoke-static {p1}, Lcom/brixd/niceapp/model/UserModel;->parseUserModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/UserModel;

    move-result-object v0

    .line 128
    .local v0, "userModel":Lcom/brixd/niceapp/model/UserModel;
    iget-object v1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$snsType:Lcom/brixd/niceapp/service/LoginService$SNSPlatform;

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/UserModel;->setPlatform(Lcom/brixd/niceapp/service/LoginService$SNSPlatform;)V

    .line 129
    if-eqz v0, :cond_3b

    .line 130
    invoke-static {p1}, Lcom/brixd/niceapp/service/UserService;->saveUserModel(Lorg/json/JSONObject;)V

    .line 132
    invoke-static {}, Lcom/brixd/niceapp/service/UserService;->initEmptyUserTrackJson()Lorg/json/JSONObject;

    .line 133
    const-string v1, "statics"

    invoke-virtual {p1, v1}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    invoke-static {v1}, Lcom/brixd/niceapp/service/UserService;->saveUserTrackModel(Lorg/json/JSONObject;)V

    .line 136
    invoke-static {v0}, Lcom/brixd/niceapp/service/UserService;->checkMessages(Lcom/brixd/niceapp/model/UserModel;)V

    .line 137
    iget-object v1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$context:Landroid/content/Context;

    invoke-static {v1}, Lcom/brixd/niceapp/sys/service/SyncService;->start(Landroid/content/Context;)V

    .line 139
    invoke-static {}, Lcom/brixd/niceapp/bus/BusProvider;->getInstance()Lcom/squareup/otto/Bus;

    move-result-object v1

    new-instance v2, Lcom/brixd/niceapp/bus/event/UserSignonEvent;

    invoke-direct {v2, v0}, Lcom/brixd/niceapp/bus/event/UserSignonEvent;-><init>(Lcom/brixd/niceapp/model/UserModel;)V

    invoke-virtual {v1, v2}, Lcom/squareup/otto/Bus;->post(Ljava/lang/Object;)V

    .line 142
    :cond_3b
    iget-object v1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$context:Landroid/content/Context;

    # invokes: Lcom/brixd/niceapp/service/LoginService;->hideLoginDialog(Landroid/content/Context;)V
    invoke-static {v1}, Lcom/brixd/niceapp/service/LoginService;->access$200(Landroid/content/Context;)V

    .line 143
    iget-object v1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$context:Landroid/content/Context;

    # invokes: Lcom/brixd/niceapp/service/LoginService;->hideLoadingDialog(Landroid/content/Context;)V
    invoke-static {v1}, Lcom/brixd/niceapp/service/LoginService;->access$000(Landroid/content/Context;)V

    .line 144
    return-void

    .line 123
    .end local v0    # "userModel":Lcom/brixd/niceapp/model/UserModel;
    :cond_46
    iget-object v1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$snsType:Lcom/brixd/niceapp/service/LoginService$SNSPlatform;

    sget-object v2, Lcom/brixd/niceapp/service/LoginService$SNSPlatform;->Weibo:Lcom/brixd/niceapp/service/LoginService$SNSPlatform;

    if-ne v1, v2, :cond_d

    .line 124
    iget-object v1, p0, Lcom/brixd/niceapp/service/LoginService$2;->val$context:Landroid/content/Context;

    const-string v2, "WeiboUserLogon"

    invoke-static {v1, v2}, Lcom/umeng/analytics/MobclickAgent;->onEvent(Landroid/content/Context;Ljava/lang/String;)V

    goto :goto_d
.end method
